import i18n from '@/i18n/index'
import store from '@/store'
import { watch } from 'vue'

export function generateTitle (title) {
  return i18n.global.t('msg.route.' + title)
}

/* 监听语言的变化 */
export function watchSwitchLang (...cbs) {
  watch(() => store.getters.language, () => {
    cbs.forEach(cb => cb())
  })
}
